
var mongoose = require('mongoose');
var Schema = mongoose.Schema;

var OrdersSchema = new Schema({
    startDate:String,
    endDate:String,
    days:Number,
    leaseUser:{
        type:Schema.Types.ObjectId,
        ref:"users"
    },//出租
    rentUser:{
        type:Schema.Types.ObjectId,
        ref:"users"
    },//租车
    car:{
        type:Schema.Types.ObjectId,
        ref:"cars"
    },
    payState:String,//未支付 已支付 进行中 完成订单 已经取消
    offerCar:Boolean,//出租提供车
    rentCheck:Boolean,//租车者确认车
    overOrder:Boolean,//出租者确认订单完成
});


mongoose.model("orders", OrdersSchema, "orders");